package com.yyq.gxdc.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yyq.gxdc.entity.User;
import com.yyq.gxdc.mapper.UserMapper;
import com.yyq.gxdc.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wwc
 * @since 2023-12-04
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public IPage<User> getAllUser(Page<User> page, User user){
        IPage<User> allUser = userMapper.getAllUser(page, user);
        return  allUser;
    };

    @Override
    public User findUserByUserName(String username){
        User userByUserName = userMapper.findUserByUserName(username);
        return userByUserName;
    };

    @Override
    public User loginUser(User user){
        User currUser = userMapper.loginUser(user);
        return currUser;
    };
}
